﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MakeItWeb.Framework
{
    public class MakeItWebUserControl : System.Web.UI.UserControl, IMakeItWebControl
    {
        public HtmlPage CurrentHtmlPage
        {
            get { return (Page as IMakeItWebControl).CurrentHtmlPage; }
        }

        public string CurrentUserName
        {
            get { return (Page as IMakeItWebControl).CurrentUserName; }
        }

        public Member CurrentMember
        {
            get { return (Page as IMakeItWebControl).CurrentMember; }
        }

        public bool WebOnlyMemberInd
        {
            get { return (Page as IMakeItWebControl).WebOnlyMemberInd; }
        }

        public bool DisplayMemberSearchInd
        {
            get
            {
                return (Page as IMakeItWebControl).DisplayMemberSearchInd;
            }
            set
            {
                (Page as IMakeItWebControl).DisplayMemberSearchInd = value;
            }
        }

        public bool DisplayDynamicBackgroundForAdmin
        {
            get { return (Page as IMakeItWebControl).DisplayDynamicBackgroundForAdmin; }
        }

        public bool IsInRole(string sRoleName)
        {
            return (Page as IMakeItWebControl).IsInRole(sRoleName);
        }

        public bool IsPageAdministrator()
        {
            return (Page as IMakeItWebControl).IsPageAdministrator();
        }

        public void RegisterAdminFunction(string sText, string sNavigationUrl, string sIconImageUrl)
        {
            (Page.Master as IMakeItWebControl).RegisterAdminFunction(sText, sNavigationUrl, sIconImageUrl);
        }

        public void ClearAdminFunctions()
        {
            (Page.Master as IMakeItWebControl).ClearAdminFunctions();
        }

        public string SelectedSection
        {
            get { return (Page as IMakeItWebControl).SelectedSection; }
        }
    }
}